using System;
using CommandSystem;

namespace CustomCharacter.Commands.CustomCharacterCommands
{
    public class CustomCharacterCommand : ParentCommand, IUsageProvider
    {
        public CustomCharacterCommand() => LoadGeneratedCommands();

        public override string Command => "customrole";

        public override string[] Aliases => Array.Empty<string>();

        public override string Description => "查询/设置玩家的自定义角色";

        public string[] Usage => new[] { "set/list", "玩家ID", "角色类名" };

        public override void LoadGeneratedCommands()
        {
            this.RegisterCommand(new List());
            this.RegisterCommand(new Set());
        }

        protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSender sender,
            out string response)
        {
            if (!sender.CheckPermission(PlayerPermissions.ForceclassWithoutRestrictions))
            {
                response = "你没有权限使用此命令！";
                return false;
            }

            response = "用法: customrole <set/list> <玩家ID> <角色类名>";
            return false;
        }
    }
}